<?php


namespace app\admin\validate;

use think\Validate;
class AdminValidate2 extends Validate
{
    protected $rule=[
        'admin_name'  => 'require|length:2,15',
        'admin_password'   => 'require|alphaDash',
        'admin_password2'   => 'require|alphaDash|confirm:admin_password'
    ];
    protected $message =[
        'admin_name.require' => '账户名称不能为空',
        'admin_name.length' =>'账户名称必须2-15字符',
        'admin_password.require' =>'密码不能为空',
        'admin_password.alphaDash'   => '密码只能字母和数字，下划线_及破折号-',
        'admin_password2.require' =>'确认密码不能为空',
        'admin_password2.alphaDash'   => '确认密码只能字母和数字，下划线_及破折号-',
        'admin_password2.confirm' => '密码和确认密码不一致',
    ];
    protected $scene =[
      'update_admin' =>['admin_name','admin_password']
    ];
}